package com.emailsystem.emailsystem.exception;

/**
 * 自定义异常枚举
 */
public enum MailExceptionEnum {
    //业务错误
    NEED_USER_NAME(10001, "用户名不能为空"),

    NEED_PASSWORD(10002, "密码不能为空"),

    PASSWORD_TOO_SHORT(10003, "密码长度不能小于8位"),

    NAME_EXISTED(10004, "不允许重名"),

    INSERT_FAILED(10005, "插入失败，请重试"),

    WRONG_PASSWORD(10006, "密码错误"),

    NEED_LOGIN(10007, "用户未登录"),
    NEED_SENDER(10008,"需要邮件发送方"),
    NEED_RECEIVER(10009,"需要邮件接收方"),
    NEED_CONTEXT(10010,"正文不能为空"),
    SERVER_IS_NOT_START(10011,"服务器还没开"),
    NEED_PORT(10012,"需要端口号"),
    NEED_IP(10013,"需要接收方的Ip地址"),

    READ_FOLDER_ERROR(10014,"文件夹读取报错"),
    WRONG_USER_OR_WRONG_PASSWORD(10014,"用户名或者密码错误"),

    File_IO_EXCEPTION(10015,"文件读写错误，请检查文件是否正确"),

    ILLEGAL_ACCOUNT(10016,"账号格式错误，请检查账号是否正确"),
    NOT_EXIST_ACCOUNT(10017,"账号不存在"),
    WRONG_SERVER(10018,"qq服务器错误"),
    WRONG_BOX_TYPE(10019,"邮箱不存在"),
    FILE_FALL_TO_DELETE(10020,"文件删除失败");;

    // 异常码
    Integer code;

    // 异常信息
    String msg;

    // 构造异常枚举
    MailExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}